package infrastructure;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import common.messages.KVMessage;

@XmlRootElement
public class KVMessageImp implements KVMessage {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String value;
	private String key;
	private StatusType status;
	
	public KVMessageImp(){		
	}
	
	public KVMessageImp(String value, String key, StatusType status) {
		this.value = value;
		this.key = key;
		this.status = status;
	}
	
	@Override
	public String getKey() {		
		return this.key;
	}
	
	@XmlElement
	public void setKey(String key) {		
		this.key = key;
	}

	@Override
	public String getValue() {
		return this.value;
	}
	
	@XmlElement
	public void setValue(String value) {
		this.value = value;
	}

	@Override
	public StatusType getStatus() {
		return status;
	}

	@XmlElement
	public void setStatus(StatusType status) {
		this.status = status;
	}
	
	@Override
	public String toString() {
		return "KVMessage status: " + this.status.toString() + " | key: " +this.key + " | value: " + this.value;
	}
}
